$(function () {
    $(".js-login-btn").click(function () {
        var loading = weui.loading('loading', {
            className: 'custom-classname'
        });
        var username = $("#username").val();
        var password = $("#password").val();
        var result = Model.admin.login({
            username: username,
            password: password
        })
        if (result.code = 1) {
            loading.hide();
            weui.toast('登录成功', {
                duration: 2000,
                className: 'custom-classname',
                callback: function () {
                    location.href = 'index.html';
                }
            });
        }

    })

})